﻿using System.Collections.Generic;

namespace DataAccessLayer
{
    using System;

    public enum AdmDepartmentSortMode { FullName, TypeAndName };

    public partial interface IDataProvider
    {
        #region ИЗВЛЕЧЕНИЕ ДАННЫХ
        IEnumerable<DTO.AdmJob> GetAdmJobs();

        IEnumerable<DTO.AdmPerson> GetAdmPersons();

        IEnumerable<DTO.AdmTerm> GetAdmTerms();

        IEnumerable<DTO.AdmPosition> GetAdmPositions();

        IEnumerable<DTO.AdmStatus> GetAdmStatuses();

        IEnumerable<DTO.AdmDegree> GetAdmDegrees();

        IEnumerable<DTO.AdmPersonDegree> GetAdmPersonDegrees(int IDTerm);

        IEnumerable<DTO.AdmCategory> GetAdmCategoriesByTerm(int IDTerm);

        IEnumerable<DTO.DTOBase> GetUniversityStructOnDemand(int IDTerm, DTO.AdmDepartment fromDepartment, bool WithRespondents);

        IEnumerable<DTO.AdmUnit> GetAdmUnits();

        IEnumerable<DTO.DTOBase> GetIndexMarkStructOnDemand(int IDTerm, DTO.AdmSection fromSection, bool WithCharacteristics);

        IEnumerable<DTO.DTOBase> GetIndexMarkStructOnDemand(int IDTerm, DTO.AdmCharacteristic characteristic);

        IEnumerable<DTO.AdmGradation> GetGradationsStruct(int IDTerm);

        IEnumerable<DTO.DTOBase> GetGradationsStructOnDemand(int IDTerm, DTO.AdmGradation fromGradation);

        IEnumerable<DTO.AdmResponsible> GetAdmResponsibles();

        IEnumerable<DTO.AdmCharacteristic> GetAdmCharacteristics();

        IEnumerable<DTO.AdmDepartment> GetAdmDepartments(AdmDepartmentSortMode sortMode);

        IEnumerable<DTO.AdmSection> GetAdmSections();

        IEnumerable<DTO.AdmGradation> GetAdmGradations();

        IEnumerable<DTO.AdmCategory> GetAdmCategories();

        IEnumerable<DTO.AdmAnswerLog> GetAnswerLog(DateTime fromDate, DateTime toDate, List<DTO.FilterItem> filters, 
            bool onlySubscribers);

        IEnumerable<DTO.AdmAnswerLog> GetAnswerLog(int IDAnswer);

        IEnumerable<DTO.AdmAnswerLog> GetAnswerLog();

        IEnumerable<DTO.AdmInputLog> GetInputLog(DateTime fromDate, DateTime toDate, List<DTO.FilterItem> filters);

        IEnumerable<DTO.AdmInputLog> GetInputLog();

        IEnumerable<DTO.AdmDepartmentType> GetAdmDepartmentTypes();
        #endregion

        #region КОПИРОВАНИЕ ДАННЫХ
        void CopyUniversityStruct2(int fromIDTerm, int toIDTerm);

        void CopyAdmCategoriesByTerm(int fromIDTerm, int toIDTerm);

        void CopyIndexMarkStruct2(int fromIDTerm, int toIDTerm);

        void CopyGradationStructElement(DTO.DTOBase copiedObject, int toIDTerm, DTO.DTOBase targetObject);

        void CopyIndexMarkElement(DTO.DTOBase copiedObject, int toIDTerm, DTO.DTOBase targetObject);

        void CopyUniversityElement(DTO.DTOBase copiedObject, int toIDTerm, DTO.DTOBase targetObject);
        #endregion

        #region СОХРАНЕНИЕ ИЗМЕНЕНИЙ
        void SaveUniversityStruct(IEnumerable<DTO.DTOBase> list);

        void SaveAdmResponsible(IEnumerable<DTO.AdmResponsible> list);

        void SaveAdmUnit(IEnumerable<DTO.AdmUnit> list);

        void SaveAdmTerm(IEnumerable<DTO.AdmTerm> list);

        void SaveAdmPerson(IEnumerable<DTO.AdmPerson> list);

        void SaveAdmJob(IEnumerable<DTO.AdmJob> list);

        void SaveAdmStatus(IEnumerable<DTO.AdmStatus> list);

        void SaveAdmPosition(IEnumerable<DTO.AdmPosition> list);

        void SaveAdmlCategoriesByTerm(IEnumerable<DTO.AdmCategory> list);

        void SaveIndexMarkStruct(IEnumerable<DTO.DTOBase> list);

        void SaveAdmCharacteristic(IEnumerable<DTO.AdmCharacteristic> list);

        void SaveAdmDepartment(IEnumerable<DTO.AdmDepartment> list);

        void SaveAdmSection(IEnumerable<DTO.AdmSection> list);

        void SaveAdmGradation(IEnumerable<DTO.AdmGradation> list);

        void SaveAdmCategory(IEnumerable<DTO.AdmCategory> list);

        void SaveAnswerLog(IEnumerable<DTO.DTOBase> list);

        void SaveInputLog(IEnumerable<DTO.AdmInputLog> list);

        void SaveAdmGradationHierarhial(IEnumerable<DTO.AdmGradation> list);

        void SaveAdmDepartmentTypes(IEnumerable<DTO.AdmDepartmentType> list);

        void SaveAdmDegree(IEnumerable<DTO.AdmDegree> list);

        void SaveAdmPersonDegrees(IEnumerable<DTO.AdmPersonDegree> list);
        #endregion

        #region УДАЛЕНИЕ ДАННЫХ
        void ClearAnswerLog();

        void ClearInputLog();

        void DeleteAdmCharacteristicRelations(DTO.AdmCharacteristic c);

        void DeleteAdmSectionRelations(DTO.AdmSection s);

        void DeleteAdmDepartmentRelations(DTO.AdmDepartment d);
        #endregion

        /// <summary>
        /// Получение флага наличия подписки
        /// </summary>
        /// <param name="SID"></param>
        /// <returns></returns>
        DTO.SubscriberState CheckSubscribe(string SID);

        /// <summary>
        /// Получение данных о подписке
        /// </summary>
        /// <param name="SID"></param>
        /// <returns></returns>
        DTO.SubscriberInfo GetSubscriberInfo(string SID);

        /// <summary>
        /// Сохранение данных о подписке
        /// </summary>
        /// <param name="subscriberInfo"></param>
        void SaveSubscriberInfo(DTO.SubscriberInfo subscriberInfo);

        IEnumerable<DTO.SubscriberInfo> GetAllActivitySubscribers(DateTime fromDate, DateTime toDate);
    }
}